A28 - Blackboard
提出
TLE
code: python
n = int(input())
res = 0
for t, a in ta:
if t == "+":
res += int(a)
elif t == "-":
res -= int(a)
else:
res *= int(a)
print(res % 10000)
解答
code: python
n = int(input())
res = 0
for t, a in ta:
if t == "+":
res += int(a)
elif t == "-":
res -= int(a)
else:
res *= int(a)
if res < 0:
res += 10000
res %= 10000
print(res)